import 'package:flutter/material.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';

class ToastHelper {
  static void success(String message, {BuildContext? context}) {
    showToast(
      message,
      context: context,
      backgroundColor: const Color(0xFF4CAF50),
      textStyle: const TextStyle(
        color: Colors.white,
        fontSize: 16,
        fontWeight: FontWeight.w500,
      ),
      toastHorizontalMargin: 20,
      borderRadius: BorderRadius.circular(12),
      duration: const Duration(seconds: 2),
      position: StyledToastPosition.center,
      animation: StyledToastAnimation.slideFromTop,
      reverseAnimation: StyledToastAnimation.slideToTop,
      animDuration: const Duration(milliseconds: 600),
      curve: Curves.easeOutBack,
      reverseCurve: Curves.easeInBack,
    );
  }

  static void error(String message, {BuildContext? context}) {
    showToast(
      message,
      context: context,
      backgroundColor: const Color(0xFFF44336),
      textStyle: const TextStyle(
        color: Colors.white,
        fontSize: 16,
        fontWeight: FontWeight.w500,
      ),
      toastHorizontalMargin: 20,
      borderRadius: BorderRadius.circular(12),
      duration: const Duration(seconds: 2),
      position: StyledToastPosition.center,
      animation: StyledToastAnimation.slideFromTop,
      reverseAnimation: StyledToastAnimation.slideToTop,
      animDuration: const Duration(milliseconds: 600),
      curve: Curves.easeOutBack,
      reverseCurve: Curves.easeInBack,
    );
  }

  static void warning(String message, {BuildContext? context}) {
    showToast(
      message,
      context: context,
      backgroundColor: const Color(0xFFFF9800),
      textStyle: const TextStyle(
        color: Colors.white,
        fontSize: 16,
        fontWeight: FontWeight.w500,
      ),
      toastHorizontalMargin: 20,
      borderRadius: BorderRadius.circular(12),
      duration: const Duration(seconds: 2),
      position: StyledToastPosition.center,
      animation: StyledToastAnimation.slideFromTop,
      reverseAnimation: StyledToastAnimation.slideToTop,
      animDuration: const Duration(milliseconds: 600),
      curve: Curves.easeOutBack,
      reverseCurve: Curves.easeInBack,
    );
  }

  static void info(String message, {BuildContext? context}) {
    showToast(
      message,
      context: context,
      backgroundColor: const Color(0xFF2196F3),
      textStyle: const TextStyle(
        color: Colors.white,
        fontSize: 16,
        fontWeight: FontWeight.w500,
      ),
      toastHorizontalMargin: 20,
      borderRadius: BorderRadius.circular(12),
      duration: const Duration(seconds: 2),
      position: StyledToastPosition.center,
      animation: StyledToastAnimation.slideFromTop,
      reverseAnimation: StyledToastAnimation.slideToTop,
      animDuration: const Duration(milliseconds: 600),
      curve: Curves.easeOutBack,
      reverseCurve: Curves.easeInBack,
    );
  }
}
